#ifndef MACRO_H
#define MACRO_H

#include <QMetaType>

// =====================================================
// DEBUG
#define DEBUG_MODE 0
// =====================================================
//
#define APP_NAME  "VIEW_EYES"
#define APP_ORG   "SKYLOGIC"
// ========================================
// device list code
#define DEV_PC 1
#define DEV_PS 2
#define DEV_PL 3

//true board code
#define DEV_PL_Z2 "Z2"
#define DEV_PL_Z7 "Z7"
#define DEV_PL_K7 "xc7k"
#define DEV_PL_X7 "xc7s"
// ========================================
//add ip list
#define DEV_PL_Z2_IP0 "192.168.120.10"
#define DEV_PL_K7_IP0 "192.168.120.12"
#define DEV_PL_K7_IP1 "192.168.120.13"

// ========================================
//add code value
//PC(1) code
#define CODE_WELCOME   0x11000000
#define CODE_NET_SET   0x11000001

#define CODE_UART_INFO 0x11000002
#define CODE_UVC_INFO  0x11000003
#define CODE_FILE_INFO 0x11000004
//PC(1) and PS(2) code
#define CODE_HELLO_PS 0x12210000
#define CODE_BMP_FILE 0x12210001

#define CODE_UART_PS  0x00210002

//PC(1) and PL(3) code , X7
#define CODE_FPGA_SET       0x13310000
#define CODE_UART_PL        0x13310001
#define CODE_UART_PL_CAMERA 0x13310002
#define CODE_FPGA_STATE     0x13310003
//PC(1) and PL(4) code, K7
#define CODE2_FPGA_SET       0x14410000
#define CODE2_UART_PL        0x14410001
#define CODE2_UART_PL_CAMERA 0x14410002
#define CODE2_FPGA_STATE     0x14410003
#define CODE2_NET_HELLO      0x14410004
//add struct
struct SUdpPck{ //little format
    quint32 pkg_code;      //class code
    quint32 pkg_len ;      //one pkg length
    quint32 pkg_wid ;      //current pkg width
    char    pkg_dat [960]; //pkg data
    quint32 pkg_xor ;      //pkg xor
};
Q_DECLARE_METATYPE(SUdpPck)


//add error macro
#define ERR_NO_ERR        0
#define ERR_TYPE_MATCH    1
#define ERR_NULL_VARIABLE 2

// ==========================================================
// color control
#define TEXT_COLOR_RED(STRING)    ("<font color=red>" + STRING + "</font>" "<font color=black> </font>")
#define TEXT_COLOR_BLUE(STRING)   ("<font color=blue>" + STRING + "</font>" "<font color=black> </font>")
#define TEXT_COLOR_GREEN(STRING)  ("<font color=green>" + STRING + "</font>" "<font color=black> </font>")
#define TEXT_COLOR_BLACK(STRING)  ("<font color=black>" + STRING + "</font>" "<font color=black> </font>")
#define TEXT_COLOR_WHITE(STRING)  ("<font color=white>" + STRING + "</font>" "<font color=black> </font>")

// =====================================================
// file mdle info
#define P_MAX_NUMB   10
#define P_VIDEO_FIFO 0
#define P_LOG_FILE   1
#define P_FPGA_FILE  2
#define P_CMD_PATH   3
#define P_CMD_DATA   4
#define P_TEAM_MDLE  5
#define P_VERSION_SYNC  6

// =====================================================
// public function name
#define F_SETWIN    setWindowFlags(Qt::WindowTitleHint  |   \
                    Qt::CustomizeWindowHint | \
                    Qt::CustomizeWindowHint | \
                    Qt::WindowMinimizeButtonHint | \
                    Qt::WindowMaximizeButtonHint);

// =====================================================
// add wave mode
#define MD_WAVE_NONE 0x00000000
#define MD_WAVE_SHOW 0x00000001

// ======================================================
// add file max title line analysis
#define NB_ROW_MAX 1000

#endif // MACRO_H

